package com.zyh.server.utils;

/**
 * 响应状态
 */
public enum  ResponseCode {
    Success(200,"服务器响应成功!"),
    Error(500,"后端服务器出错!"),
    NeedLogin(401,"系统提示:请先登录!"),
    TokenFailed(403,"系统提示:token失效,请重新登录!");

    private final int code;
    private final String desc;

    /**
     * 构造函数，用于初始化ResponseCode对象
     *
     * @param code 状态码，用于表示响应的状态
     * @param desc 描述信息，用于详细说明响应的状态
     */
    ResponseCode(int code ,String desc){
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
